#include <iostream >
#define MAX 2000
using namespace std;
int a[MAX];
int main()
{
	int n;
	cin>>n;
	memset(a,0,sizeof(a));
	a[0]=1;
	int s;
	for(int i=2;i<=n;i++){
		int jinwei=0;
		for(int j=0;j<MAX;j++){
			s=a[j]*i+jinwei;
			a[j]=s%10;
			jinwei=s/10;	
		}
	}
	int i;
	for(i=MAX-1;i>=0;i--){
		if(a[i]) break;
	}
	for(;i>=0;i--) cout<<a[i];
	cout<<endl;
}
